<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>title</title>
		<link rel="stylesheet" type="text/css" href="../../css/api.css"/>
			<link rel="stylesheet" href="../../css/mui.min.css"/>

		<link rel="stylesheet" href="../../css/base.css"/>
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">		<style>
			html, body {
				width: 100%;
				height: 100%;
				background: #FFFFFF;
				margin: 0px;
			}
			p {
				display: block;
				-webkit-margin-before: 0em;
				-webkit-margin-after: 0em;
				-webkit-margin-start: 0px;
				-webkit-margin-end: 0px;
			}
			.top_title {
				width: 100%;
				height: 44px;
				background: #18b4ed;
				display: -webkit-box;
			}
			.top_left {
				width: 50px;
				height: 44px;
			}
			.top_left img {
				width: 13px;
				height: 20px;
				margin: 10px;
			}
			.top_center {
				-webkit-box-flex: 1;
				height: 44px;
				line-height: 44px;
				text-align: -webkit-center;
			}
			.top_center p {
				font-size: 18px;
				color: #FFFFFF;
			}
			.top_right {
				width: 50px;
				height: 44px;
			}
			.top_right img {
				width: 20px;
				height: 20px;
				padding-bottom: 12px;
				padding-top: 12px;
				padding-left: 15px;
			}
			.show_img {
				width: 100%;
				height: 190px;
			}
			.show_img img {
				width: 100%;
				height: 100%;
			}
			.intro {
				width: 100%;
				height: auto;
				padding-bottom: 10px;
			}
			.intro_title {
			
				padding: 10px;
			}
			.intro_int {
			
				line-height: 20px;
				padding-left: 10px;
				padding-right: 10px;
			}
			.butom {
				margin-bottom: 30px;
				margin-top: 30px;
				margin: 40px auto;
				width: 80%;
				padding: 8px 0;
				font-size: 18px;
				display: block;
				color: #fff;
				border: 1px solid #f0ad4e;
				background-color: #f0ad4e;
			}
			/*table { border-collapse: collapse;}*/
			td {
				border-style: solid;
				border-width: 1px 1px 1px 1px;
				border-color: #333333;
			}
			.cents{
				text-align: center;
			}
			h1,h2,h3{
			font-weight: normal;
			}
		span{color: #333333;font-size: 14px}
		</style>
	</head>
	<body>
		<div id="mian">
			<div class="show_img"  >
				<img   id="img_title" src="../../image/course_placehoder.png" />
			</div>
			<div class="intro">
				<!--<div>-->
				<p class="intro_title base_title_font  base_black_grey" id="deta_ms_title"></p>
				<p class="intro_int base_dark_grey base_content_font " id="deta_ms"></p>
				<p class="intro_title base_title_font  base_black_grey" id="deta_fy_title"></p>
				<p class="intro_int base_dark_grey base_content_font" id="deta_fy"></p>
				<p class="intro_title base_title_font  base_black_grey" id="deta_ks_title"></p>
				<p class="intro_int base_dark_grey base_content_font" id="deta_ks"></p>
				<!--</div>-->
			</div>
			<div style="width: 100%;height: 5px;background-color: #f0f0f0;"></div>
			<div>
			<!--	<p class="intro_title base_title_font  base_dark_grey" id="deta_ys_title"></p>-->
				<div id="deta_ys" style="padding-left: 10px;padding-right: 10px;padding-top:10px;color: #000000;font-size: 14px" ></div>
			</div>
		</div>
		<div class="noSign" hidden="hidden" id="noData">
		<img src="../../image/icon_img.png" width="60%">
		<p class="font16 top_15 base_dark_grey" >
			暂无数据
		</p>
	</div>
	<div class="loadFailure" hidden="hidden" id="noNet">
		<img src="../../image/icon_img01.png" width="60%">
		<p class="" >
			数据加载失败
		</p>
		<p>
			请检查您的网络
		</p>
		<button type="button"  onclick="loadData()"class="mui-btn mui-btn-outlined">
			重新加载
		</button>
	</div>	
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/MD5.js"></script>
	<script src="../../script/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../script/requestTool.js"></script>
	<script src="../../script/common.js"></script>

	<script type="text/javascript">
		var ids = "";
		var moneys = "";
		var ispay  ='';//    : 是否支付
        var learn_plan  ='' ;//学习进度
		apiready = function() {
			ids = api.pageParam.id;
			loadData()
		
			
		};
		function loadData() {

			var params = {
				jid : "338",
				uid : $api.getStorage("cfnetppuid"),
				id : ids
			};
   
			showProgress();
			cfnetppPOST(url_getQuarterInfo, params, true, function(data, status) {
				hideProgress();
//				alert(JSON.stringify(data));
				if (status == "success") {
					var codes = data.code;
					if (codes == "200") {
				
                       $("#img_title").attr("src",  getpicurl(data.data.img));
                   
						var dree = data.data.quarter_describe;
						setdesc(dree);
						moneys = data.data.apply_money;
						$api.setStorage("pay_money",moneys);// 支付金额
						$api.setStorage("jobs_id",ids);// 岗位id
					    learn_plan =data.data.learn_plan;
					     ispay = data.data.ispay;
					     //发送学习状态的通知
						api.sendEvent({
				            name:'ispay',
				             extra: {
						        ispay: ispay,
						        learn_plan: learn_plan
			             }
			            });
						setysu(data.data.quarter_factor);
					} else if (codes == "101") {
						api.toast({
							msg : '参数错误！！'
						});
					} else {
						api.toast({
							msg : '数据请求出错！！'
						});
					}
				} else {
				     $('#mian').hide();
					 $('#noNet').show();
				}
			});
		}

		function setdesc(datas) {
			var str = datas.replace("岗位描述：", "");
			str = str.replace("费用说明：", "1111");
			str = str.replace("考试说明：", "1111");
			var ssd = new Array();
			ssd = str.split("1111");
			$("#deta_ms_title").html("岗位描述");
			if (ssd[0] == "" || typeof (ssd[0]) == "undefined") {
				$("#deta_ms").html("暂无数据");
			} else {
				$("#deta_ms").html(ssd[0]);
			}
			$("#deta_fy_title").html("费用说明");
			if (ssd[1] == "" || typeof (ssd[1]) == "undefined") {
				$("#deta_fy").html("暂无数据");
			} else {
				$("#deta_fy").html(ssd[1]);
			}
			$("#deta_ks_title").html("考试说明");
			$("#deta_ks").html(ssd[2]);
			if (ssd[2] == "" || typeof (ssd[2]) == "undefined") {
				$("#deta_ks").html("暂无数据");
			} else {
				$("#deta_ks").html(ssd[2]);
			}
		}

		function setysu(data) {
//			$("#deta_ys_title").html("岗位要素");
			var htmls = data;
			if (data == "" || typeof (data) == "undefined") {
				hts = '<div><p class="intro_int base_dark_grey base_content_font">暂无数据</p></div>'
				$("#deta_ys").html(hts);
			} else {
//			console.log(htmls);
//			alert(htmls);
				$("#deta_ys").html(htmls);

			}
		}
	</script>
</html>